Skip to content

feat: Add Select component for form inputs - #34

Draft
noofreuuuh with Copilot wants to merge 2 commits into
mainfrom
copilot/add-select-component
Draft

noofreuuuh with Copilot wants to merge 2 commits into
mainfrom
copilot/add-select-component

Conversation

Copilot AI commented Jun 4, 2026 •

Copy link
Copy Markdown
Contributor

The design system lacked a native <Select> component, forcing consumers to hand-roll styled <select> elements inconsistently. This adds a fully-featured Select component aligned with the existing Input visual contract.

Component API

<Select
  id="model-select"
  value={selectedValue}
  onChange={(value) => setSelectedValue(value)}
  placeholder="Select a model"
  error="Please select a value"
  size="md"
  fullWidth
>
  <Select.Option value="gpt-4">GPT-4</Select.Option>
  <Select.Option value="claude-3">Claude 3</Select.Option>
</Select>

Key design decisions:

  • onChange receives string directly (not a ChangeEvent) — matches the expected API from the issue
  • error is a string (not boolean) — component owns error message display with aria-describedby wiring
  • Placeholder rendered as disabled hidden option — appears in closed state but cannot be re-selected
  • Select.Option is a compound sub-component wrapping native <option> for ergonomic usage
  • Ref forwarded to the underlying <select> element

Implementation

  • Select.tsx — forwardRef wrapper around native <select>, compound with Select.Option
  • Select.module.css — Reuses --lufa-component-input-* tokens for visual parity with Input; size variants (sm/md/lg) use the same padding/font-size token ladder as the input token set
  • Exports: Select, SelectProps, SelectSizeValue

Coverage

  • Playwright CT: a11y, rendering, all states (error, disabled, fullWidth, sizes), onChange value delivery, aria-describedby association, visual regression snapshots
  • Storybook: Default, Placeholder, States, Size, FullWidth stories
  • Docusaurus: live demos + full props reference

Copilot AI linked an issue Jun 4, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add Select component for form inputs feat: Add Select component for form inputs Jun 4, 2026
Copilot AI requested a review from noofreuuuh June 4, 2026 21:23
Copilot AI added 2 commits September 29, 2026 00:27
- Add Select component with Select.Option compound sub-component
- Support placeholder, error message, disabled, fullWidth, size (sm/md/lg)
- Reuse component-input tokens for visual consistency with Input
- Forward ref to native <select> element
- Accessible: aria-invalid, aria-describedby for errors
- Add Playwright CT tests
- Add Storybook stories
- Add Docusaurus examples and documentation
- Add `hidden` attribute to placeholder option to prevent re-selection
- Rename SizeValue to SelectSizeValue for consistent naming
- Remove type alias in exports
@noofreuuuh
noofreuuuh force-pushed the copilot/add-select-component branch from 4235f48 to f7249ff Compare September 28, 2026 22:27
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Changeset Validation Failed

The following packages have been modified but are not included in any changeset:

  • @grasdouble/lufa_design-system
  • @grasdouble/lufa_design-system-docusaurus
  • @grasdouble/lufa_design-system-playwright
  • @grasdouble/lufa_design-system-storybook

What you need to do:

  1. Run pnpm changeset to create a new changeset
  2. Select the modified packages that need version bumps
  3. Choose the appropriate version bump (major, minor, or patch)
  4. Write a clear description of the changes
  5. Commit the generated changeset file

All modified packages:

  • ❌ @grasdouble/lufa_design-system
  • ❌ @grasdouble/lufa_design-system-docusaurus
  • ❌ @grasdouble/lufa_design-system-playwright
  • ❌ @grasdouble/lufa_design-system-storybook

Why is this important?

Changesets ensure that:

  • All package changes are properly versioned
  • Changelogs are automatically generated
  • Dependent packages are updated correctly
  • Release notes are comprehensive

Need help?

@github-actions

Copy link
Copy Markdown
Contributor

⚡ Performance Budget Report

✅ All Performance Budgets Passed!

Your changes meet all performance requirements. Great work! 🎉

📊 Performance Metrics

Metric Current Budget Status
Bundle Size 287.04 KB 300 KB ✅ Pass
JS Size 96.11 KB — ℹ️ Info
CSS Size 190.93 KB — ℹ️ Info
Gzipped Size 48.73 KB 50 KB ✅ Pass
Build Time 10.08s 30s ✅ Pass
CSS Cascade 153ms 1000ms ✅ Pass

📦 Size Breakdown

JavaScript : 96.11 KB
CSS        : 190.93 KB
─────────────────────
Total      : 287.04 KB
Gzipped    : 48.73 KB (16% of uncompressed)

⏱️ Timing Breakdown

Build       : 10.08s
CSS Cascade : 153ms

📊 View full run details

@github-actions

Copy link
Copy Markdown
Contributor

🧩 Design System Packages — CI Report

⚠️ 2 check(s) failed

Please review and fix the issues highlighted below.

📋 Check Summary

Package Check Status
🪙 Tokens validate:tokens ✅ Passed
🪙 Tokens prettier:check ✅ Passed
🎨 Themes lint ✅ Passed
🎨 Themes typecheck ✅ Passed
🎨 Themes validate:token-usage ✅ Passed
🎨 Themes validate:theme:all ✅ Passed
🎨 Themes prettier:check ✅ Passed
🧩 Main lint ✅ Passed (2 warning(s))
🧩 Main typecheck ✅ Passed
🧩 Main validate:token-usage ✅ Passed
🧩 Main validate:components:strict ✅ Passed
🧩 Main prettier:check ✅ Passed
📖 Storybook lint ✅ Passed
📖 Storybook typecheck ❌ Failed
📖 Storybook validate:token-usage ✅ Passed
📖 Storybook prettier:check ✅ Passed
🔧 CLI lint ✅ Passed
🔧 CLI typecheck ✅ Passed
🔧 CLI validate:token-usage ✅ Passed
🔧 CLI prettier:check ✅ Passed
📚 Docusaurus lint ✅ Passed
📚 Docusaurus typecheck ✅ Passed
📚 Docusaurus validate:token-usage ✅ Passed
📚 Docusaurus prettier:check ❌ Failed
🎭 Playwright lint ✅ Passed
🎭 Playwright typecheck ✅ Passed
🎭 Playwright validate:token-usage ✅ Passed
🎭 Playwright prettier:check ✅ Passed

💡 How to Fix

  • Storybook — typecheck: pnpm --filter @grasdouble/lufa_design-system-storybook run typecheck
  • Docusaurus — prettier: pnpm --filter @grasdouble/lufa_design-system-docusaurus run prettier:write

📊 View full run details

@github-actions

Copy link
Copy Markdown
Contributor

🎭 Playwright Component Test Results

⚠️ Test Failures Detected

Some tests failed or visual differences were detected. Please review below.

Metric Count
Total Tests 843
Passed 841
Failed 2 ❌
Visual Diffs 0
Execution Time N/As

📋 Components Tested

All design system components were tested in:

  • ☀️ Light mode
  • 🌙 Dark mode
  • 💻 Desktop viewport (1280x720)

Tested Components:

  • Box, Stack, Text, Icon
  • Button, Badge, Divider
  • Center, Container, Flex, Grid
  • Portal, VisuallyHidden, Label
  • Input, Card (compositions)

🔧 Troubleshooting

Common causes of test failures or visual differences:

  1. Token changes - Updated design tokens affect component styling
  2. CSS changes - Modified component styles or utility classes
  3. Font changes - Font family or weight modifications
  4. Layout changes - Padding, margin, or sizing adjustments
  5. Browser updates - Rendering engine differences

Run tests locally:

# Run component tests
pnpm --filter @grasdouble/lufa_design-system-playwright test

# Update snapshots if changes are intentional
pnpm --filter @grasdouble/lufa_design-system-playwright test-ct:update-snapshots

# Run tests in UI mode for debugging
pnpm --filter @grasdouble/lufa_design-system-playwright test-ct:ui

📊 View full test report

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add Select component for form inputs

2 participants